/*- coding = utf-8 -*-
@Time : 2023/7/15 9:29
@Author : 管茂良
@File : index.ts
@web  : www.php-china.com
@Software: WebStorm
*/

import {imgDirective,imgComponents} from "./imageLazyLoading"
import {App} from "vue";
let modules = [imgDirective]
let comps = [imgComponents]
const install = (app:App,options?:any) =>{
    comps.map((component:any)=>{
        app.component(component.__name as string, component);
    })
    modules.map((component:any)=>{
        component(app,options)
    })
}

let windowObj = window as any
/* 支持使用标签的方式引入 */
if (typeof windowObj !== 'undefined' && windowObj.Vue) {
    const vm = windowObj.Vue.createApp({})
    install(vm)
}

export default install
